Page({
  data: {
    showQRCode: false
  },

  // 返回上一页
  onBackTap() {
    wx.navigateBack();
  },

  // 复制账号
  copyAccount(e) {
    const { type, account } = e.currentTarget.dataset;
    wx.setClipboardData({
      data: account,
      success: () => {
        let title = '复制成功';
        if (type === 'wechat') {
          title = '微信号已复制，请前往微信添加好友';
        } else if (type === 'qq') {
          title = 'QQ号已复制，请前往QQ添加好友';
        }
        wx.showToast({
          title: title,
          icon: 'none',
          duration: 2000
        });
      }
    });
  }
}); 